#include "kdcsubtitle.h"

#include <KIcon>
#include <KLocale>
#include <kdclib.h>

KDCSubtitle::KDCSubtitle( KDCObject *aParent ) : KDCObject ( KDC::Subtitle, aParent ), pSize( 10 ), pHorizontalAlignment( Qt::AlignHCenter ), pVerticalAlignment( Qt::AlignBottom )
{

}

KDCSubtitle::~KDCSubtitle()
{

}

int KDCSubtitle::size() const
{
	return pSize;
}
	
void KDCSubtitle::setSize( int aSize )
{
	pSize = aSize;
}

QString KDCSubtitle::title() const
{
	return i18n("Subtitles");
}

KIcon KDCSubtitle::icon() const
{
	return KIcon();
}

void KDCSubtitle::setHorizontalAlignment( Qt::Alignment aAlignment )
{
	pHorizontalAlignment = aAlignment;
}

Qt::Alignment KDCSubtitle::horizontalAlignment() const
{
	return pHorizontalAlignment;
}

void KDCSubtitle::setVerticalAlignment( Qt::Alignment aAlignment )
{
	pVerticalAlignment = aAlignment;
}

Qt::Alignment KDCSubtitle::verticalAlignment() const
{
	return pVerticalAlignment;
}

void KDCSubtitle::add( Subtitle *aSubtitle )
{
	pSubtitle.append( aSubtitle );
}

void KDCSubtitle::remove( int aIndex )
{
	if ( isInRange( aIndex, 0, pSubtitle.size() - 1 ) )
		pSubtitle.removeAt( aIndex );
}

void KDCSubtitle::move( int aFrom, int aTo )
{
	if ( isInRange( aFrom, 0, pSubtitle.size() - 1 ) && isInRange( aTo, 0, pSubtitle.size() - 1 ) )
		pSubtitle.move( aFrom, aTo );
}

const QList<Subtitle*>& KDCSubtitle::subtitles() const
{
	return pSubtitle;
}
